﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TheStar.Lib
{
    public class BranchAndBoundEst : BranchAndBound
    {
        private readonly IProblemGraphEst problemEst;

        public BranchAndBoundEst(IProblemGraphEst problem) : base(problem)
        {
            this.problemEst = problem;
        }

        protected override void SetAditionalCost(Path path)
        {
            EstimatedPath estPath = (EstimatedPath)path;
            estPath.EstimatedCost = this.problemEst.GetEstimatedCost(path.Last, this.problemEst.Destination);
        }
        protected override Path NewPath(object node)
        {
            return new EstimatedPath(node);
        }
    }
}
